﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using WiseLinkWPF.Windows.Controls.GridView;
using WiseLinkWPF.Windows.Controls;
using CCF20Model;
using System.Windows.Media;

namespace CCF20Module
{
    public class CurrentMaintenanceStyle : System.Windows.Controls.StyleSelector
    {
        public override Style SelectStyle(object item, DependencyObject container)
        {
            var style = new Style(typeof(GridViewRow));
            
            

            if (item is CombinedMaintenanceType)
            {

                CombinedMaintenanceType combinedType = item as CombinedMaintenanceType;
                if (combinedType.IsHistory)
                {
                    style.Setters.Add(new Setter(GridViewRow.BackgroundProperty, new SolidColorBrush(Colors.Yellow)));
                }
                
            }

            return style;

        }
        
    }
}
